import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '@/page/layout/Layout.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '@/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/risk',
                    component: () => import(/* webpackChunkName: "dashboard" */ '@/page/riskControl/RiskList.vue'),
                    meta: { title: '风险控制' }
                },
                {
                    path: '/demand-follow',
                    component: () => import(/* webpackChunkName: "dashboard" */ '@/page/nankang/DemandFollow.vue'),
                    meta: { title: '印章管理' },
                },
                {
                    path: '/product',
                    name: 'productManage',
                    component: () => import(/* webpackChunkName: "dashboard" */ '@/page/production-manage/ProductManage.vue'),
                    meta: { title: '产品管理' },
                },
                {
                    path: '/materials',
                    name: 'productMaterials',
                    component: () => import(/* webpackChunkName: "dashboard" */ '@/page/production-manage/ProductMaterial.vue'),
                    meta: { title: '物料管理' },
                },
                {
                    path: '/production-manage',
                    redirect: {
                        name: 'productMaterials'
                    },
                    meta: { title: '风险控制' },
                    children: [
                        {
                            path: '/product',
                            name: 'productManage',
                            component: () => import(/* webpackChunkName: "dashboard" */ '@/page/production-manage/ProductManage.vue'),
                            meta: { title: '风险控制' },
                        },
                        {
                            path: '/materials',
                            name: 'productMaterials',
                            component: () => import(/* webpackChunkName: "dashboard" */ '@/page/production-manage/ProductMaterial.vue'),
                            meta: { title: '风险控制' },
                        }
                    ]
                },
                {
                    path: '',
                    component: () => import(/* webpackChunkName: "icon" */ '@/page/setting/Layout.vue'),
                    meta: { title: '自定义图标' },
                    redirect: {
                        name: 'enterprise'
                    },
                    children: [
                        {
                            path: '/enterprise',
                            name: 'enterprise',
                            component: () => import(/* webpackChunkName: "icon" */ '@/page/setting/Enterprise.vue'),
                            meta: {
                                title: '企业账户'
                            }
                        },
                        {
                            path: '/bank',
                            name: 'bank',
                            component: () => import(/* webpackChunkName: "icon" */ '@/page/setting/Bank.vue'),
                            meta: {
                                title: '合作银行'
                            }
                        },
                        {
                            path: '/credit',
                            name: 'credit',
                            component: () => import(/* webpackChunkName: "icon" */ '@/page/setting/Credit.vue'),
                            meta: {
                                title: '授信企业'
                            }
                        },
                        {
                            path: '/sensitive',
                            name: 'sensitive',
                            component: () => import(/* webpackChunkName: "icon" */ '@/page/setting/Sensitive.vue'),
                            meta: {
                                title: '敏感行业'
                            }
                        },
                        {
                            path: '/Intercept',
                            name: 'Intercept',
                            component: () => import(/* webpackChunkName: "icon" */ '@/page/setting/Intercept.vue'),
                            meta: {
                                title: '风控拦截'
                            }
                        },
                        {
                            path: '/black',
                            name: 'black',
                            component: () => import(/* webpackChunkName: "icon" */ '@/page/setting/Black.vue'),
                            meta: {
                                title: '黑名单'
                            }
                        }
                    ]
                },
                // {
                //     path: '/table',
                //     component: () => import(/* webpackChunkName: "table" */ '../components/page/BaseTable.vue'),
                //     meta: { title: '基础表格' }
                // },
                // {
                //     path: '/tabs',
                //     component: () => import(/* webpackChunkName: "tabs" */ '../components/page/Tabs.vue'),
                //     meta: { title: 'tab选项卡' }
                // },
                // {
                //     path: '/form',
                //     component: () => import(/* webpackChunkName: "form" */ '../components/page/BaseForm.vue'),
                //     meta: { title: '基本表单' }
                // },
                // {
                //     // 富文本编辑器组件
                //     path: '/editor',
                //     component: () => import(/* webpackChunkName: "editor" */ '../components/page/VueEditor.vue'),
                //     meta: { title: '富文本编辑器' }
                // },
                // {
                //     // markdown组件
                //     path: '/markdown',
                //     component: () => import(/* webpackChunkName: "markdown" */ '../components/page/Markdown.vue'),
                //     meta: { title: 'markdown编辑器' }
                // },
                // {
                //     // 图片上传组件
                //     path: '/upload',
                //     component: () => import(/* webpackChunkName: "upload" */ '../components/page/Upload.vue'),
                //     meta: { title: '文件上传' }
                // },
                // {
                //     // vue-schart组件
                //     path: '/charts',
                //     component: () => import(/* webpackChunkName: "chart" */ '../components/page/BaseCharts.vue'),
                //     meta: { title: 'schart图表' }
                // },
                // {
                //     // 拖拽列表组件
                //     path: '/drag',
                //     component: () => import(/* webpackChunkName: "drag" */ '../components/page/DragList.vue'),
                //     meta: { title: '拖拽列表' }
                // },
                // {
                //     // 拖拽Dialog组件
                //     path: '/dialog',
                //     component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/DragDialog.vue'),
                //     meta: { title: '拖拽弹框' }
                // },
                // {
                //     // 国际化组件
                //     path: '/i18n',
                //     component: () => import(/* webpackChunkName: "i18n" */ '../components/page/I18n.vue'),
                //     meta: { title: '国际化' }
                // },
                // {
                //     // 权限页面
                //     path: '/permission',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                //     meta: { title: '权限测试', permission: true }
                // },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '@/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '@/page/403.vue'),
                    meta: { title: '403' }
                },
                {
                    path: '/donate',
                    component: () => import(/* webpackChunkName: "donate" */ '@/page/Donate.vue'),
                    meta: { title: '支持作者' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '@/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
